package com.mumuso.mumusoitem.service.lmpl;

import com.mumuso.mumusoitem.mapper.dArcItemPreErrorMessageMapper;
import com.mumuso.mumusoitem.pojo.dArcItemPreErrorMessage;
import com.mumuso.mumusoitem.service.dArcItemPreErrorMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class dArcItemPreErrorMessageServicelmpl implements dArcItemPreErrorMessageService {


    @Autowired
    private dArcItemPreErrorMessageMapper dArcItemPreErrorMessageMapper;


    /**
     * 查询所有错误信息记录
     * @return
     */
    @Override
    public List<dArcItemPreErrorMessage> selectAllErrorMessages() {
        return dArcItemPreErrorMessageMapper.selectAllErrorMessages();
    }


    /**
     * 批量添加错误信息
     * @param errorMessageList
     */
    @Override
    public int batchInsertErrorMessage(List<dArcItemPreErrorMessage> errorMessageList) {
        return dArcItemPreErrorMessageMapper.batchInsertErrorMessage(errorMessageList);
    }

    /**
     * 根据商品编号查询出该商品下所有的问题点
     * @param itemId
     * @return
     */
    @Override
    public List<dArcItemPreErrorMessage> selectAllErrorInfoByItemId(String itemId) {
        return dArcItemPreErrorMessageMapper.selectAllErrorInfoByItemId(itemId);
    }

    /**
     * 根据商品编号删除该商品下所有问题标记点
     * @param itemId
     * @return
     */
    @Override
    public int deleteAllErrorByItemId(String itemId) {
        return dArcItemPreErrorMessageMapper.deleteAllErrorByItemId(itemId);
    }

    /**
     * 根据商品编号和序号删除错误标记
     * @param itemId
     * @param series
     * @return
     */
    @Override
    public int deleteErrorInfoByItemIdAndSeries(String itemId, String series) {
        return dArcItemPreErrorMessageMapper.deleteErrorInfoByItemIdAndSeries(itemId, series);
    }

    /**
     * 获取所有数量
     * @param itemId
     * @return
     */
    @Override
    public int countAllErrorByItemId(String itemId) {
        return dArcItemPreErrorMessageMapper.countAllErrorByItemId(itemId);
    }

    /**
     * 通过商品编号获取错误信息
     * @param itemId
     * @return
     */
    @Override
    public List<dArcItemPreErrorMessage> selectErrorInfoByUnionStaffName(String itemId) {
        return dArcItemPreErrorMessageMapper.selectErrorInfoByUnionStaffName(itemId);
    }
}
